module.exports = function(grunt) {

    // Project configuration.
    var filesList = [
        'js/GameUtils.js',
        'js/Load.js',
        'js/Home.js',
        'js/Game.js'
    ];
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        uglify: {
            options: {
                banner: '/*!<%=pkg.name%>-<%=pkg.version%>.js <%=grunt.template.today("yyyy-mm-dd") %>*/\n'
            },
            build: {
                files: {
                    'build/<%=pkg.name%>-<%=pkg.version%>.min.js': filesList
                }
            }
        },
        concat: {
            options: {
                 
            },
            dist: {
                  src:filesList,
                  dest: 'build/<%=pkg.name%>.js',
            }
        },
        watch: {
          scripts: {
            files: filesList,
            tasks: ['default'],
            options: {
              spawn: false,
            }
          }
        },
        browserSync: {
            bsFiles: {
                src :['css/*.css','js/*.js','index.html']
            },
            options: {
                server: {
                    baseDir: "./"
                },
                port:4500
            }
        },
        wiredep: {

          task: {
            src: [
              'index.html'
            ],

            options: {
            
            }
          }
        },
        jsdoc : {
            dist : {
                src: ['js/*.js'],
                options: {
                    destination: 'docs',
                    encoding: "utf8",
                    recurse: true,
                    readme:"README.md",
                    access:"all",
                    template:"node_modules/minami"
                }
            }
        }
    });
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-wiredep');
    grunt.loadNpmTasks('grunt-browser-sync');
    grunt.loadNpmTasks('grunt-jsdoc');
    grunt.registerTask('default', ['concat','uglify','wiredep','browserSync']);
    // grunt.registerTask('default', ['jshint']);
};
